home *** CD-ROM | disk | FTP | other *** search
- //========================================================================================
- //
- // File: Proxy.cpp
- // Release Version: $ ODF 1 $
- //
- // Author: M.Boetcher
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "Embedder.hpp"
-
- // ----- Embedder Part Includes -----
-
- #ifndef PROXY_H
- #include "Proxy.h"
- #endif
-
- #ifndef PART_H
- #include "Part.h"
- #endif
-
- #ifndef FRAME_H
- #include "Frame.h"
- #endif
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- // ----- ODF Includes -----
-
- #ifndef FWFRMING_H
- #include "FWFrming.h"
- #endif
-
- #ifndef FWUTIL_H
- #include "FWUtil.h"
- #endif
-
- #ifndef FWPRESEN_H
- #include "FWPresen.h"
- #endif
-
- #ifndef FWFCTCLP_H
- #include "FWFctClp.h"
- #endif
-
- #ifndef FWODGEOM_H
- #include "FWODGeom.h"
- #endif
-
- #ifndef FWITERS_H
- #include "FWIters.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_ODShape_xh
- #include <Shape.xh>
- #endif
-
- #ifndef SOM_ODTransform_xh
- #include <Trnsform.xh>
- #endif
-
- #ifndef SOM_ODSession_xh
- #include <ODSessn.xh>
- #endif
-
- //========================================================================================
- // RunTime Info
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment embedder
- #endif
-
- //========================================================================================
- // class CEmbedderProxy
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CEmbedderProxy constructors
- //----------------------------------------------------------------------------------------
-
- CEmbedderProxy::CEmbedderProxy(Environment* ev, CEmbedderPart* part, FW_CPresentation* presentation) :
- FW_MProxy(ev, part, presentation),
- fPart(part)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CEmbedderProxy::~CEmbedderProxy
- //----------------------------------------------------------------------------------------
-
- CEmbedderProxy::~CEmbedderProxy()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CEmbedderProxy::UsedShapeChanged
- //----------------------------------------------------------------------------------------
- // Used shape of an embedderded frame changed. Just invalidate and recalculate its clip
-
- void CEmbedderProxy::UsedShapeChanged(Environment* ev,
- FW_CEmbeddingFrame* embedderdingFrame,
- ODFrame* odEmbeddedFrame)
- {
- FW_UNUSED(odEmbeddedFrame);
-
- // ----- Recalculate the clip -----
- if (fPart->FacetNumber() == cOneFacet)
- {
- // ----- Use the standard facet clipper
- FW_CFacetClipper clipper(ev, fPart);
- clipper.Clip(ev, embedderdingFrame);
- }
- else
- {
- // I cannot use the standard facet clipper because it only works for one facet
- // Because I know in which order the facets were created I can just iterates
- FW_CRect clipRects[4];
- ((CEmbedderFrame*)embedderdingFrame)->EmbeddedFacetBounds(ev, clipRects);
-
- FW_CFrameFacetIterator ite(ev, embedderdingFrame);
- for (ODFacet* facet = ite.First(ev); ite.IsNotComplete(ev); facet = ite.Next(ev))
- {
- short n = 0;
- FW_CFacetIterator ite2(ev, facet);
- for (ODFacet* embedderdedFacet = ite2.First(ev); ite2.IsNotComplete(ev); embedderdedFacet = ite2.Next(ev))
- {
- FW_CAcquiredODShape aqClipShape = FW_NewODShape(ev, clipRects[n]);
- embedderdedFacet->ChangeGeometry(ev, aqClipShape, NULL, NULL);
- n++;
- }
- }
- }
-
- embedderdingFrame->Invalidate(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // CEmbedderProxy::FrameShapeRequested
- //----------------------------------------------------------------------------------------
- // We always want the embedderded frame to have our frame shape
-
- ODShape* CEmbedderProxy::FrameShapeRequested(Environment* ev,
- FW_CEmbeddingFrame* embedderdingFrame,
- ODFrame* odEmbeddedFrame,
- ODShape* requestedFrameShape)
- {
- FW_UNUSED(requestedFrameShape);
- FW_UNUSED(odEmbeddedFrame);
-
- return ((CEmbedderFrame*)embedderdingFrame)->MakeFrameShape(ev); // No FW_CAcquiredODShape because we are returning it
- }
-
-
-